<form class="layui-form" onsubmit="return false;">
    <input type="hidden" name="id" value="#(bean.id??)">
    <div class="main-container">
        <div class="layui-form-item">
            <label class="layui-form-label required">公告标题</label>
            <div class="layui-input-block">
                <input type="text" name="title" value="#(bean.title??)" lay-verify="required" autocomplete="off" placeholder="请输入公告标题" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">公告类型</label>
            <div class="layui-input-inline">
                <select name="type" lay-verify="required">
                    <option value="">-- 请选择 --</option>
                #DICTS(type="notice_type")#for(item : dicts)
                    <option value="#(item.value)"#if(item.value == bean.type??) selected#end>#(item.label)</option>
                #end#end
                </select>
            </div>
            <label class="layui-form-label required">状态</label>
            <div class="layui-input-inline">
                <input type="radio" name="status" value="ON" title="启用" #if(bean.status?? == 'ON' || bean.status?? == null) checked #end>
                <input type="radio" name="status" value="OFF" title="禁用" #if(bean.status?? == 'OFF') checked #end>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">公告内容</label>
            <div class="layui-input-block">
            	<textarea id="content_edit" rows="22">#(bean.content??)</textarea>
            	<input id="content-editor" type="hidden" name="content" value="#(bean.id??)">
            </div>
        </div>
    </div>
    <div class="layui-form-item" style="display: none;">
        <div class="layui-input-block">
            <button type="submit" onclick="layui.jquery('#content-editor').val(window.ceEditor.getContent());" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="data-save" id="data-save">
                <i class="layui-icon layui-icon-ok"></i> 提交
            </button>
        </div>
    </div>
</form>
#include("/admin/_common/foot.html")
<script type="text/javascript">
layui.use(['jquery', 'form', 'tinymce'], function() {
    var $ = layui.jquery;
    var form = layui.form;
    var tinymce = layui.tinymce
    
    window.ceEditor = tinymce.render({
		elem: "#content_edit",
		resize: true,
		menubar: false,
		toolbar: 'code undo redo | forecolor backcolor bold italic underline strikethrough | indent2em alignleft aligncenter alignright alignjustify outdent indent | link bullist numlist table codesample | formatselect fontselect fontsizeselect',
		auto_focus: true
	});
});
</script>
